package org.example.ch02.p11;

import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n=Integer.parseInt(scanner.nextLine());
        double[][]equations = new double[n][n+1];
        for (int i = 0; i < n; i++) {
            String[]parts=scanner.nextLine().split(" ");
            for (int j = 0; j < n+1; j++) {
                equations[i][j]=Double.parseDouble(parts[j]);
            }
        }
        System.out.println(Arrays.deepToString(equations));
        for (int i = 0; i < n; i++) {
            StringBuilder sb=new StringBuilder();
            for (int j = 0; j < n; j++) {
                sb.append(equations[i][j]).append(", ");
            }
            sb.setLength(sb.length()-2);
            sb.append(" = ").append(equations[i][n]);
            System.out.println(sb.toString());
        }
        scanner.close();
    }
}
